#ifndef LOCALTARGETADAPTER_H
#define LOCALTARGETADAPTER_H

#include "fileutils.h"
#include "fileinfo.h"
#include "abstracttargetadapter.h"

class LocalTargetAdapter : public AbstractTargetAdapter
{
public:
    LocalTargetAdapter(QString sourcePath, QString targetPath, QString diffPath = "");

    QHash<QString, FileInfo> createFileTable(bool calculateHashes);
    QHash<QString, FileInfo> loadFileTable(bool oldTable);
    QDirIterator *getFilesInSource();
    QString getSourcePath();
    QString getTargetPath();
    quint64 getDirSize(QHash<QString, FileInfo> table);
    quint64 getDirSize(QDirIterator *it);
    void backupFile(QString fileName);
    void restoreFile(QString fileName);
    void createDiff(QString fileName);
    void restoreDiff(QString fileName);
    void finalize();
private:
    QString sourcePath;
    QString targetPath;
    QString diffPath;
};

#endif // LOCALTARGETADAPTER_H
